from translate import getTrans 
with open('shu.txt','a+') as possFile:#with的用法，打开需要写入的文本,没有自动新建
    with open('字典.txt','r') as passFile:#打开需要读取的文本。
        for line in passFile.readlines():#一行一行的读取
            #print(line)
            password = line.strip()#去掉行首的空格和\n和尾的空格和\n
            #如'\n  ff  \n'
            
            shiyi=getTrans(password)#调用翻译函数并返回中文释义
            possFile.write(password+'\t'+shiyi+'\n')#使得到apple\t苹果
            
        
        
